故障恢复系统部署报告
======================

部署时间: {{ ansible_date_time.iso8601 }}
部署主机: {{ ansible_hostname }} ({{ ansible_default_ipv4.address }})
部署用户: {{ ansible_user_id }}

部署组件:
---------
✓ 故障恢复配置文件: {{ failover_config_dir }}/config.yml
✓ 健康检查脚本: {{ failover_home_dir }}/health_check.py
✓ 故障恢复管理器: {{ failover_home_dir }}/failover_manager.py
✓ SystemD服务文件: ~/.config/systemd/user/failover-monitor.service
✓ SystemD定时器文件: ~/.config/systemd/user/failover-monitor.timer
✓ 启动脚本: {{ failover_home_dir }}/start_monitoring.sh
✓ 停止脚本: {{ failover_home_dir }}/stop_monitoring.sh

配置信息:
---------
监控间隔: {{ failover_check_interval | default(60) }}秒
日志目录: {{ failover_log_dir | default(failover_home_dir + '/logs') }}
状态文件: {{ failover_state_file | default(failover_home_dir + '/state.json') }}
历史文件: {{ failover_history_file | default(failover_home_dir + '/history.json') }}

服务状态:
---------
{% if systemd_status is defined %}
{% for service in systemd_status.results %}
{{ service.name }}: {{ service.status.ActiveState | default('unknown') }}
{% endfor %}
{% endif %}

使用说明:
---------
1. 启动监控: {{ failover_home_dir }}/start_monitoring.sh
2. 停止监控: {{ failover_home_dir }}/stop_monitoring.sh
3. 查看日志: tail -f {{ failover_log_dir }}/monitoring.log
4. 手动检查: python3 {{ failover_home_dir }}/health_check.py
5. 查看状态: python3 {{ failover_home_dir }}/failover_manager.py status

部署完成!